package com.aidex.biz.service.impl;

import com.aidex.biz.domain.AppVersion;
import com.aidex.biz.mapper.AppVersionMapper;
import com.aidex.biz.service.AppVersionService;
import com.aidex.common.annotation.DataScope;
import com.aidex.common.core.service.BaseServiceImpl;
import com.aidex.common.utils.NumberUtils;
import com.github.pagehelper.PageInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * APP管理Service业务层处理
 * @author sean
 * @email 2074844820@qq.com
 * @date 2025-08-16
 */
@Service
@Transactional(readOnly = true)
public class AppVersionServiceImpl extends BaseServiceImpl<AppVersionMapper, AppVersion> implements AppVersionService
{
    private static final Logger log = LoggerFactory.getLogger(AppVersionServiceImpl.class);

    /**
     * 获取单条数据
     * @param appVersion APP管理
     * @return APP管理
     */
    @Override
    public AppVersion get(AppVersion appVersion)
    {
        AppVersion dto = super.get(appVersion);
        return dto;
    }

    /**
     * 获取单条数据
     * @param id APP管理id
     * @return APP管理
     */
    @Override
    public AppVersion get(String id)
    {
        AppVersion dto = super.get(id);
        return dto;
    }


    /**
     * 查询APP管理列表
     * @param appVersion APP管理
     * @return APP管理
     */
    @Override
    @DataScope(userAlias = "a",deptAlias = "a")
    public List<AppVersion> findList(AppVersion appVersion)
    {
        return super.findList(appVersion);
    }

    /**
     * 分页查询APP管理列表
     * @param appVersion APP管理
     * @return APP管理
     */
    @Override
    @DataScope(userAlias = "a",deptAlias = "a")
    public PageInfo<AppVersion> findPage(AppVersion appVersion)
    {
        return super.findPage(appVersion);
    }

    /**
     * 保存APP管理
     * @param appVersion
     * @return 结果
     */
    @Override
    public boolean save(AppVersion appVersion)
    {
        return super.save(appVersion);
    }


    /**
     * 删除APP管理信息
     * @param appVersion
     * @return 结果
     */
    @Override
    public boolean remove(AppVersion appVersion)
    {
        return super.remove(appVersion);
    }

    /**
     * 批量删除APP管理
     * @param ids 需要删除的APP管理ID
     * @return 结果
     */
    @Transactional(readOnly = false)
    @Override
    public int deleteAppVersionByIds(String[] ids)
    {
        return mapper.deleteAppVersionByIds(ids);
    }

    /**
     * 获取最大编号
     * @param appVersion APP管理
     * @return 结果
     */
    @Override
    public int findMaxSort(AppVersion appVersion)
    {
        return NumberUtils.nextOrder(mapper.findMaxSort(appVersion));
    }
}
